//
// Created by 45512 on 2021/11/18.
//
#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    int n,X,Y;
    cin >> n >> X >> Y;
    pair<int,int> pos[n];
    int length[n];
    for (int i=0;i<n;i++){
        cin >> pos[i].first >> pos[i].second;
        length[i] =  (pos[i].first-X)*(pos[i].first-X) + (pos[i].second-Y)*(pos[i].second-Y);
    }


    for (int j=0;j<3;j++){
        int a = length[0];
        int index = 0;
        for (int i = 1; i < n; i++) {
            if (length[i] < a) {
                index = i;
                a = length[i];
            }
        }
        length[index] = 100000;
        cout << index + 1 << endl;
    }
    return 0;

}
